#ifndef HTTP_REQUEST_HEADER_H
#define HTTP_REQUEST_HEADER_H

#include "HttpHeader.h"

namespace fx {

    FX_DECLARE_CLASS(HttpRequestHeader);

    class HttpRequestHeader
        : public HttpHeader
    {
    public:
        virtual ~HttpRequestHeader();

        static HttpRequestHeaderPtr Create();
        static HttpRequestHeaderPtr Create(const std::string& str_buf);
        static HttpRequestHeaderPtr Create(std::istream& iss);

        const std::string& GetMethod() const { return method_; }
        const std::string& GetPath() const { return path_; }
        const std::string& GetProtocol() const { return protocol_; }
        const std::string& GetVersion() const { return version_; }

        void SetMethod(const std::string& method);
        void SetPath(const std::string& path);
        void SetProtocol(const std::string& protocol);
        void SetVersion(const std::string& version);

    protected:
        HttpRequestHeader();

        virtual bool ParseFirstLine();
        virtual void UpdateFirstLine();

    protected:
        std::string method_;
        std::string path_;
        std::string protocol_;
        std::string version_;
    };

}

#endif // HTTP_REQUEST_HEADER_H
